VERSION 5.00
Object = "{C71107CA-CFEF-4025-9142-19260D6BE9A5}#1.0#0"; "MVDEVICE.ocx"
Begin VB.Form Form1 
   BorderStyle     =   5  'Sizable ToolWindow
   Caption         =   "Form1"
   ClientHeight    =   9750
   ClientLeft      =   60
   ClientTop       =   225
   ClientWidth     =   13110
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9750
   ScaleWidth      =   13110
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin MVDEVICELib.MVDEVICE MVDEVICE1 
      Height          =   8295
      Left            =   240
      TabIndex        =   23
      Top             =   240
      Width           =   10095
      _Version        =   65536
      _ExtentX        =   17806
      _ExtentY        =   14631
      _StockProps     =   224
      DispWidth       =   553
   End
   Begin VB.CommandButton Command8 
      Caption         =   "压缩存储"
      Height          =   375
      Left            =   11400
      TabIndex        =   22
      Top             =   2160
      Width           =   1455
   End
   Begin VB.CommandButton Command7 
      Caption         =   "输出低电平"
      Height          =   375
      Left            =   11400
      TabIndex        =   18
      Top             =   6480
      Width           =   1455
   End
   Begin VB.CommandButton Command5 
      Caption         =   "输出高电平"
      Height          =   375
      Left            =   11400
      TabIndex        =   17
      Top             =   6000
      Width           =   1455
   End
   Begin VB.CommandButton Command2 
      Caption         =   "外触发有效"
      Height          =   375
      Left            =   11400
      TabIndex        =   16
      Top             =   5520
      Width           =   1455
   End
   Begin VB.Frame Frame1 
      Caption         =   "当前采集卡信息："
      Height          =   735
      Left            =   240
      TabIndex        =   12
      Top             =   8880
      Width           =   10935
      Begin VB.Label Label3 
         Caption         =   "采集卡类型："
         Height          =   255
         Left            =   2520
         TabIndex        =   15
         Top             =   360
         Width           =   1215
      End
      Begin VB.Label Label2 
         Height          =   255
         Left            =   3840
         TabIndex        =   14
         Top             =   360
         Width           =   2175
      End
      Begin VB.Label Label1 
         Caption         =   "采集卡数："
         Height          =   255
         Left            =   120
         TabIndex        =   13
         Top             =   360
         Width           =   1455
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "采集参数设置"
      Height          =   375
      Left            =   11400
      TabIndex        =   11
      Top             =   3120
      Width           =   1455
   End
   Begin VB.CommandButton Command6 
      Caption         =   "采集颜色设置"
      Height          =   375
      Left            =   11400
      TabIndex        =   10
      Top             =   3600
      Width           =   1455
   End
   Begin VB.CommandButton Command4 
      Caption         =   "采集格式设置"
      Height          =   375
      Left            =   11400
      TabIndex        =   9
      Top             =   4080
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "采集大小设置"
      Height          =   375
      Left            =   11400
      TabIndex        =   8
      Top             =   4560
      Width           =   1455
   End
   Begin VB.CommandButton PauseVideo 
      Caption         =   "暂停采集"
      Height          =   375
      Left            =   11400
      TabIndex        =   7
      Top             =   1080
      Width           =   1455
   End
   Begin VB.CommandButton CapFrame 
      Caption         =   "保存单帧图片"
      Height          =   375
      Left            =   11400
      TabIndex        =   6
      Top             =   1680
      Width           =   1455
   End
   Begin VB.CommandButton SetCircle 
      Caption         =   "叠加圆"
      Height          =   375
      Left            =   11400
      TabIndex        =   5
      Top             =   8400
      Width           =   1455
   End
   Begin VB.CommandButton SetLine 
      Caption         =   "叠加直线"
      Height          =   375
      Left            =   11400
      TabIndex        =   4
      Top             =   7920
      Width           =   1455
   End
   Begin VB.CommandButton SetText 
      Caption         =   "叠加字符"
      Height          =   375
      Left            =   11400
      TabIndex        =   3
      Top             =   7440
      Width           =   1455
   End
   Begin VB.CommandButton CloseDevice 
      Caption         =   "关闭设备"
      Height          =   375
      Left            =   11400
      TabIndex        =   2
      Top             =   9120
      Width           =   1455
   End
   Begin VB.CommandButton ActivateVideo 
      Caption         =   "实时采集"
      Height          =   375
      Left            =   11400
      TabIndex        =   1
      Top             =   600
      Width           =   1455
   End
   Begin VB.CommandButton OpenDevBtn 
      Caption         =   "初始化采集卡"
      Height          =   375
      Left            =   11400
      TabIndex        =   0
      Top             =   120
      Width           =   1455
   End
   Begin VB.Label Label6 
      Caption         =   "字符图形叠加："
      Height          =   255
      Left            =   11520
      TabIndex        =   21
      Top             =   7200
      Width           =   1335
   End
   Begin VB.Label Label5 
      Caption         =   "输入/输出控制："
      Height          =   255
      Left            =   11520
      TabIndex        =   20
      Top             =   5280
      Width           =   1455
   End
   Begin VB.Label Label4 
      Caption         =   "视频参数设置："
      Height          =   255
      Left            =   11520
      TabIndex        =   19
      Top             =   2880
      Width           =   1335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim res As Boolean

Private Sub ActivateVideo_Click()
res = MVDEVICE1.ActivateVideo(0)
End Sub

Private Sub CapFrame_Click()
res = MVDEVICE1.CaptureOneFrame(0, 0, False)
res = MVDEVICE1.SaveBMPFile(0, 0, False, "test.bmp")
End Sub

Private Sub CloseDevice_Click()
res = MVDEVICE1.StopVideo(0)
res = MVDEVICE1.CloseDevice(0)
Unload Me
End Sub

Private Sub Command1_Click()
SetParaDlg.Show
End Sub

Private Sub Command2_Click()
If Command2.Caption = "外触发有效" Then
    MVDEVICE1.SetTrigerIn 0, 0, True
    Command2.Caption = "外触发无效"
Else
    MVDEVICE1.SetTrigerIn 0, 0, False
    Command2.Caption = "外触发有效"
End If
End Sub

Private Sub Command3_Click()
SetSizeDlg.Show
End Sub

Private Sub Command4_Click()
SetBitDespDlg.Show
End Sub

Private Sub Command5_Click()
MVDEVICE1.SetTrigerOut 0, True
End Sub

Private Sub Command6_Click()
SetColorDlg.Show
End Sub

Private Sub Command7_Click()
MVDEVICE1.SetTrigerOut 0, False
End Sub

Private Sub Command8_Click()
If Command8.Caption = "压缩存储" Then
    MVDEVICE1.CompressStart 0, "mvc.avi"
    Command8.Caption = "停止压缩"
Else
    MVDEVICE1.CompressStop
    Command8.Caption = "压缩存储"
End If
End Sub

Private Sub Form_Load()
Label1.Caption = "设备总数:" & MVDEVICE1.DeviceNum

res = MVDEVICE1.OpenDevice(0)
Label2.Caption = MVDEVICE1.GetDeviceName
res = MVDEVICE1.SetCaptureSample(0, 768, 576)
res = MVDEVICE1.SetVideoSample(0, 768, 576)
MVDEVICE1.SetDispWindow 0, 0, 0, 576, 768
res = MVDEVICE1.ActivateVideo(0)
End Sub


Private Sub Form_Unload(Cancel As Integer)
res = MVDEVICE1.CloseDevice(0)
End Sub

Private Sub OpenDevBtn_Click()
res = MVDEVICE1.OpenDevice(0)
Label2.Caption = MVDEVICE1.GetDeviceName
res = MVDEVICE1.SetCaptureSample(0, 768, 576)
res = MVDEVICE1.SetVideoSample(0, 768, 576)
MVDEVICE1.SetDispWindow 0, 0, 0, 576, 768
End Sub


Private Sub PauseVideo_Click()
res = MVDEVICE1.StopVideo(0)
End Sub

Private Sub SetCircle_Click()
res = MVDEVICE1.SetBufferType(0, 1)
res = MVDEVICE1.SetOverlayCircle(0, 0, 120, 120, 240, 240)
End Sub

Private Sub SetLine_Click()
res = MVDEVICE1.SetBufferType(0, 1)
res = MVDEVICE1.SetOverlayGraphPen(0, 0, 0, 1, 64000)
res = MVDEVICE1.SetOverlayLine(0, 0, 40, 40, 240, 240)
End Sub

Private Sub SetText_Click()
res = MVDEVICE1.SetBufferType(0, 1)
res = MVDEVICE1.SetOverlayText(0, 0, " ", 40, 20)
res = MVDEVICE1.SetOverlayTextColor(0, 0, 64000)
res = MVDEVICE1.SetOverlayText(0, 1, " ", 40, 40)
res = MVDEVICE1.SetOverlayTextColor(0, 1, 64000)
res = MVDEVICE1.SetOverlayText(0, 2, "Test For Overlay", 40, 60)
res = MVDEVICE1.SetOverlayTextColor(0, 2, 64000)
res = MVDEVICE1.SetOverlayTextFont(0, 2, 12, 0)
res = MVDEVICE1.SetOverlayText(0, 3, "北京微视新纪元科技有限公司", 40, 100)
res = MVDEVICE1.SetOverlayTextColor(0, 3, 255)
res = MVDEVICE1.SetOverlayTextFont(0, 3, 24, 0)
End Sub

